// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.characters;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import zombie.core.math.PZMath;

public final class Stats {
    public float Anger = 0.0F;
    public float boredom = 0.0F;
    public float endurance = 1.0F;
    public boolean enduranceRecharging = false;
    public float endurancelast = 1.0F;
    public float endurancedanger = 0.25F;
    public float endurancewarn = 0.5F;
    public float fatigue = 0.0F;
    public float fitness = 1.0F;
    public float hunger = 0.0F;
    public float idleboredom = 0.0F;
    public float morale = 0.5F;
    public float stress = 0.0F;
    public float Fear = 0.0F;
    public float Panic = 0.0F;
    public float Sanity = 1.0F;
    public float Sickness = 0.0F;
    public float Boredom = 0.0F;
    public float Pain = 0.0F;
    public float Drunkenness = 0.0F;
    public int NumVisibleZombies = 0;
    public int LastNumVisibleZombies = 0;
    public boolean Tripping = false;
    public float TrippingRotAngle = 0.0F;
    public float thirst = 0.0F;
    public int NumChasingZombies = 0;
    public int LastVeryCloseZombies = 0;
    public static int NumCloseZombies = 0;
    public int LastNumChasingZombies = 0;
    public float stressFromCigarettes = 0.0F;
    public float ChasingZombiesDanger;
    public int MusicZombiesVisible = 0;
    public int MusicZombiesTargeting = 0;

    public int getNumVisibleZombies() {
        return this.NumVisibleZombies;
    }

    public int getNumChasingZombies() {
        return this.LastNumChasingZombies;
    }

    public int getNumVeryCloseZombies() {
        return this.LastVeryCloseZombies;
    }

    public void load(DataInputStream input) throws IOException {
        this.Anger = input.readFloat();
        this.boredom = input.readFloat();
        this.endurance = input.readFloat();
        this.fatigue = input.readFloat();
        this.fitness = input.readFloat();
        this.hunger = input.readFloat();
        this.morale = input.readFloat();
        this.stress = input.readFloat();
        this.Fear = input.readFloat();
        this.Panic = input.readFloat();
        this.Sanity = input.readFloat();
        this.Sickness = input.readFloat();
        this.Boredom = input.readFloat();
        this.Pain = input.readFloat();
        this.Drunkenness = input.readFloat();
        this.thirst = input.readFloat();
    }

    public void load(ByteBuffer input, int WorldVersion) throws IOException {
        this.Anger = input.getFloat();
        this.boredom = input.getFloat();
        this.endurance = input.getFloat();
        this.fatigue = input.getFloat();
        this.fitness = input.getFloat();
        this.hunger = input.getFloat();
        this.morale = input.getFloat();
        this.stress = input.getFloat();
        this.Fear = input.getFloat();
        this.Panic = input.getFloat();
        this.Sanity = input.getFloat();
        this.Sickness = input.getFloat();
        this.Boredom = input.getFloat();
        this.Pain = input.getFloat();
        this.Drunkenness = input.getFloat();
        this.thirst = input.getFloat();
        if (WorldVersion >= 97) {
            this.stressFromCigarettes = input.getFloat();
        }
    }

    public void save(DataOutputStream output) throws IOException {
        output.writeFloat(this.Anger);
        output.writeFloat(this.boredom);
        output.writeFloat(this.endurance);
        output.writeFloat(this.fatigue);
        output.writeFloat(this.fitness);
        output.writeFloat(this.hunger);
        output.writeFloat(this.morale);
        output.writeFloat(this.stress);
        output.writeFloat(this.Fear);
        output.writeFloat(this.Panic);
        output.writeFloat(this.Sanity);
        output.writeFloat(this.Sickness);
        output.writeFloat(this.Boredom);
        output.writeFloat(this.Pain);
        output.writeFloat(this.Drunkenness);
        output.writeFloat(this.thirst);
    }

    public void save(ByteBuffer output) throws IOException {
        output.putFloat(this.Anger);
        output.putFloat(this.boredom);
        output.putFloat(this.endurance);
        output.putFloat(this.fatigue);
        output.putFloat(this.fitness);
        output.putFloat(this.hunger);
        output.putFloat(this.morale);
        output.putFloat(this.stress);
        output.putFloat(this.Fear);
        output.putFloat(this.Panic);
        output.putFloat(this.Sanity);
        output.putFloat(this.Sickness);
        output.putFloat(this.Boredom);
        output.putFloat(this.Pain);
        output.putFloat(this.Drunkenness);
        output.putFloat(this.thirst);
        output.putFloat(this.stressFromCigarettes);
    }

    public float getAnger() {
        return this.Anger;
    }

    public void setAnger(float _Anger) {
        this.Anger = _Anger;
    }

    public float getBoredom() {
        return this.boredom;
    }

    public void setBoredom(float _boredom) {
        this.boredom = _boredom;
    }

    public float getEndurance() {
        return this.endurance;
    }

    public void setEndurance(float _endurance) {
        this.endurance = _endurance;
    }

    public float getEndurancelast() {
        return this.endurancelast;
    }

    public void setEndurancelast(float _endurancelast) {
        this.endurancelast = _endurancelast;
    }

    public float getEndurancedanger() {
        return this.endurancedanger;
    }

    public void setEndurancedanger(float _endurancedanger) {
        this.endurancedanger = _endurancedanger;
    }

    public float getEndurancewarn() {
        return this.endurancewarn;
    }

    public void setEndurancewarn(float _endurancewarn) {
        this.endurancewarn = _endurancewarn;
    }

    public boolean getEnduranceRecharging() {
        return this.enduranceRecharging;
    }

    public float getFatigue() {
        return this.fatigue;
    }

    public void setFatigue(float _fatigue) {
        this.fatigue = _fatigue;
    }

    public float getFitness() {
        return this.fitness;
    }

    public void setFitness(float _fitness) {
        this.fitness = _fitness;
    }

    public float getHunger() {
        return this.hunger;
    }

    public void setHunger(float _hunger) {
        this.hunger = _hunger;
    }

    public float getIdleboredom() {
        return this.idleboredom;
    }

    public void setIdleboredom(float _idleboredom) {
        this.idleboredom = _idleboredom;
    }

    public float getMorale() {
        return this.morale;
    }

    public void setMorale(float _morale) {
        this.morale = _morale;
    }

    public float getStress() {
        return this.stress + this.getStressFromCigarettes();
    }

    public void setStress(float _stress) {
        this.stress = _stress;
    }

    public float getStressFromCigarettes() {
        return this.stressFromCigarettes;
    }

    public void setStressFromCigarettes(float _stressFromCigarettes) {
        this.stressFromCigarettes = PZMath.clamp(_stressFromCigarettes, 0.0F, this.getMaxStressFromCigarettes());
    }

    public float getMaxStressFromCigarettes() {
        return 0.51F;
    }

    public float getFear() {
        return this.Fear;
    }

    public void setFear(float _Fear) {
        this.Fear = _Fear;
    }

    public float getPanic() {
        return this.Panic;
    }

    public void setPanic(float _Panic) {
        this.Panic = _Panic;
    }

    public float getSanity() {
        return this.Sanity;
    }

    public void setSanity(float _Sanity) {
        this.Sanity = _Sanity;
    }

    public float getSickness() {
        return this.Sickness;
    }

    public void setSickness(float _Sickness) {
        this.Sickness = _Sickness;
    }

    public float getPain() {
        return this.Pain;
    }

    public void setPain(float _Pain) {
        this.Pain = _Pain;
    }

    public float getDrunkenness() {
        return this.Drunkenness;
    }

    public void setDrunkenness(float _Drunkenness) {
        this.Drunkenness = _Drunkenness;
    }

    public int getVisibleZombies() {
        return this.NumVisibleZombies;
    }

    public void setNumVisibleZombies(int _NumVisibleZombies) {
        this.NumVisibleZombies = _NumVisibleZombies;
    }

    public boolean isTripping() {
        return this.Tripping;
    }

    public void setTripping(boolean _Tripping) {
        this.Tripping = _Tripping;
    }

    public float getTrippingRotAngle() {
        return this.TrippingRotAngle;
    }

    public void setTrippingRotAngle(float _TrippingRotAngle) {
        this.TrippingRotAngle = _TrippingRotAngle;
    }

    public float getThirst() {
        return this.thirst;
    }

    public void setThirst(float _thirst) {
        this.thirst = _thirst;
    }

    public void resetStats() {
        this.Anger = 0.0F;
        this.boredom = 0.0F;
        this.fatigue = 0.0F;
        this.hunger = 0.0F;
        this.idleboredom = 0.0F;
        this.morale = 0.5F;
        this.stress = 0.0F;
        this.Fear = 0.0F;
        this.Panic = 0.0F;
        this.Sanity = 1.0F;
        this.Sickness = 0.0F;
        this.Boredom = 0.0F;
        this.Pain = 0.0F;
        this.Drunkenness = 0.0F;
        this.thirst = 0.0F;
    }
}
